#include <stdio.h>

int main(int argc, char *argv[])
{
	int n, ans;
	int c[2002] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
	int i, j;

	scanf("%d", &n);

	for (i=10; i<2002; i++) {
		c[i] = c[i/10] + c[i%10];
	}

	n -= 4; ans = 0;
	for (i=0; i<800; i++) {
		for (j=0; j<800; j++) {
			if (c[i] + c[j] + c[i+j] == n) ans++;
		}
	}

	printf("%d\n", ans);

	return 0;
}
